import {request} from "@/utils/request.js"
//首页轮播
export function apiGetBanner(){
	return request({
		url:"/listArticleByLabelTop"	
	})	
}
//首页公告
export function apiGetNotice(){
	return request({
		url:"/listArticleNotice"	
	})	
}

//查询公告
export function apiGetNoticeById(noticeId){
	return request({
		url:"/getNoticeById?noticeId=" + noticeId,
		
	})	
}

//查询最新文章
export function apiGetNewArticle(){
	return request({
		url:"/getApiGetNewArticle",
		
	})	
}

//查询文章分类
export function apiGetClassify(){
	return request({
		url:"/getApiArticleClassify",
		
	})	
}
//查询文章分类的置顶文章，分类轮播图
export function apiGetClassifyBanner(id){
	return request({
		url:"/getClassifyBanner?id=" + id,
		
	})	
}

//查询文章分类的文章
export function apiGetClassifyArticle(data){
	return request({
		url:"/getClassifyArticle",
		data
	})	
}

//获取验证码
export function apiGetCode(){
	return request({
		url:"/getArticleCode",
	})	
}


//发起登录
export function apiLogin(data){
	return request({
		url:"/getApiLogin",
		method:'POST',
		data
	})	
}

//发起登注册
export function apiRegister(data){
	return request({
		url:"/getApiRegister",
		method:'POST',
		data
	})	
}



//获取用户信息
export function apiGetUserInfo(token){
	return request({
		url:"/getUserInfo",
		header:{"token":token}
	})	
}

//查询文章详情
export function apiGetArticleDetails(id){
	return request({
		url:"/getArticleDetails/"+id,

	})	
}

//文章点赞
export function apiGetArticleLike(data){
	return request({
		url:"/getArticleLike",
		method:'POST',
		data	
	})	
}

//查询用户是否为文章点赞
export function apiGetArticleIsLike(data){
	return request({
		url:"/getArticleIsLike",
		method:'POST',
		data	
	})	
}

//文章收藏
export function apiGetArticleCollect(data){
	return request({
		url:"/getArticleCollect",
		method:'POST',
		data	
	})	
}

//查询用户是否收藏文章
export function apiGetArticleIsCollect(data){
	return request({
		url:"/getArticleIsCollect",
		method:'POST',
		data	
	})	
}


//查询评论列表
export function apiGetReviewList(articleId,userId){
	return request({
		url:"/getReviewList?contentId="+ articleId+"&userId=" + userId ,	
	})	
}

//评论点赞接口
export function apiGetArticleReviewLike(data){
	return request({
		url:"/getArticleReviewLike",
		method:'POST',
		data	
	})	
}

//获取文章作者信息
export function apiGetArticAuthor(articleId){
	return request({
		url:"/getArticAuthor/" + articleId,	
	})	
}

//新增一级评论
export function apiGetArtiReviewOne(data){
	return request({
		url:"/getArtiReviewOne",
		method:'POST',
		data
	})	
}

//新增二级评论
export function apiGetArtiReviewTwo(data){
	return request({
		url:"/getArtiReviewTwo",
		method:'POST',
		data
	})	
}

//删除评论
export function apiDelArticReview(reviewId){
	return request({
		url:"/getDelArticReview/" + reviewId,	
	})	
}

//点击关注
export function apiDelArticPassivity(data){
	return request({
		url:"/getDelArticPassivity",	
		method:'POST',
		data
	})	
}

//查询用户是否关注了该文章作者
export function apiDelArticIsPassivity(data){
	return request({
		url:"/getDelArticIsPassivity",	
		method:'POST',
		data
	})	
}


//查询某用户写的文章
export function apiArticByUserId(userId){
	return request({
		url:"/getArticByUserId/" + userId,
	})	
}
//查询关注列表
export function apiGetLikeList(userId){
	return request({
		url:"/getLikeList/" + userId,
	})	
}